﻿using OnlineAuction.Business;
using OnlineAuction.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace OnlineAuction
{
    public partial class UserInfo : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.Cookies["UserInfo"] != null)
            {
                UserBO bo = new UserBO();
                var user = bo.GetUser(Request.Cookies["UserInfo"]["UserName"].ToString());
                lbUsername.Text = user.UserName;
                lbFullName.Text = user.UserFullName;
                if (user.UserGender.CompareTo("1") == 0 || user.UserGender.CompareTo("True") == 0)
                {
                    lbGender.Text = "Male";
                }
                else
                {
                    lbGender.Text = "Female";
                }
                lbPhoneNumber.Text = user.UserPhoneNumber;
                lbAddress.Text = user.UserAddress;
                lbEmail.Text = user.UserEmail;
                lbIdentityCard.Text = user.UserIdentityCard;
                lbVirtualMoney.Text = user.VirtualMoney;
            }
            else
            {
                Response.Redirect("Home.aspx");
            }
        }
    }
}